package priv.pfz.qatool.model;

import com.alibaba.fastjson.annotation.JSONField;
import com.google.common.collect.Maps;

import java.util.Map;

/**
 * Created by fangzhou.peng on 2017/8/3.
 * 用于制作带简易界面的工具
 */
public class QT {

    /**
     * java对象
     */
    @JSONField(serialize = false)
    private Object obj;

    /**
     * 类名
     */
    private String className;

    /**
     * 工具名
     */
    private String name;

    /**
     * 方法map
     */
    private Map<String, QTMethod> methodMap = Maps.newLinkedHashMap();

    public QT() {

    }

    public Object getObj() {
        return obj;
    }

    public void setObj(Object obj) {
        this.obj = obj;
    }

    public String getClassName() {
        return className;
    }

    public void setClassName(String className) {
        this.className = className;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Map<String, QTMethod> getMethodMap() {
        return methodMap;
    }

    public QTMethod getMethod(String methodName) {
        return methodMap.get(methodName);
    }

    public void setMethodMap(Map<String, QTMethod> methodMap) {
        this.methodMap = methodMap;
    }

    public void addMethod(QTMethod QTMethod) {
        methodMap.put(QTMethod.getMethodName(), QTMethod);
    }
}
